# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Thorsten Töpper <atsutane-tu@freethoughts.de>
# Contributor: Olivier Médoc <o_medoc@yahoo.fr>
# Contributor: Ashok `ScriptDevil` Gautham <ScriptDevil.Arch@gmail.com>

pkgname=libdbi-drivers
pkgver=0.9.0
pkgrel=10
pkgdesc="Database drivers for libdbi (MySQL, PostgreSQL, and SQLite)"
url="http://libdbi-drivers.sourceforge.net/"
license=('LGPL')
arch=('loong64' 'x86_64')
depends=('libdbi')
makedepends=('mariadb-libs' 'postgresql-libs' 'sqlite')
optdepends=('mariadb-libs: To work with MariaDB using libdbdmysql'
            'postgresql-libs: To work with PostgreSQL using libdbdpgsql'
            'sqlite: To work with SQLite using libdbdsqlite3')
source=("https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz")
sha1sums=('8472875d30c216540d48d591b442e40ba4f7df5d')

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --localstatedir=/var \
              --with-mysql --with-pgsql --with-sqlite3
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
}
